/* eslint-disable no-restricted-syntax */
import { getType } from '@/utils/utils';
/**
 * 将对象处理成数组，对象的value作为数组的值
 */
export const getEffectSource = (obj = {}) => {
    const result = [];
    Object.values(obj).forEach(item => {
        result.push(item)
    })
    return result;
};
/**
 * 遍历所有必填项
 * @param {Object} Object
 * @param  string
 * @returns {boolean} boolean
 */
export const everyRequire = (obj = {}, array = []) => {
    let flag = true;
    array.forEach(item => {
        Object.keys(obj).forEach(I => {
            if (item === I && getType(obj[I]) !== 'boolean' && !obj[I]) {
                flag = false;
            }
        })
    });
    return flag;
};
